<template>
  <div>
    <div>
      <m-header></m-header>
      <div class="content">
        <my-content class="left"></my-content>
        <div class="right">
          <div class="title">推荐阅读</div>
          <div class="item" v-for="item in recommendList" :key="item.id">
            <a href="/artical?id=1" target="_blank">{{ item.title }}</a>
          </div>
        </div>
      </div>
      <bottom></bottom>
    </div>
  </div>
</template>

<script>
import mHeader from "@/components/header.vue";
import bottom from "@/components/bottom.vue";
import myContent from "./components/content.vue";

export default {
  components: {
    mHeader,
    bottom,
    myContent,
  },
  data() {
    return {
      diseaseDetail: {},
      recommendList:{}
    };
  },
  created() {
    // let {id} = this.$route.query
    // this.getDataList(id)
    this.getRecommend()
  },
  methods: {
    getDataList(id) {
      this.HttpService.getDiseaseDetail({ id: id }).then((res) => {
        console.log(res);
        this.diseaseDetail = res.data;
      });
    },
    getRecommend() {
    this.HttpService.getRecommend().then((res) => {
      console.log(res);
      this.recommendList = res.data;
    });
  },
  },
  
};
</script>

<style lang='less' scoped>
.content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  .left {
    width: 78%;
  }
  .right {
    width: 20%;
    background-color: #fff;
    height: 300px;
    padding: 0px 10px;
    .title {
      font-size: 20px;
      line-height: 50px;
      color: #000;
    }
    .item {
      line-height: 30px;
      max-width: 200px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      a {
        color: #444;
      }
    }
  }
}
</style>
